package com.tuanzi.loan.business.service.family.impl;

import com.tuanzi.loan.business.entity.family.LoanLargeOuterTemplate;
import com.tuanzi.loan.business.repository.family.LoanLargeOuterTemplateRepository;
import com.tuanzi.loan.business.service.family.LoanLargeOuterTemplateService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.repository.JPAAuditRepository;
import com.tuanzi.loan.core.service.BaseAuditServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.LoanLargeOuterTempLateListRequest;
import com.tuanzi.loan.vo.response.family.LoanLargeOuterTempLateListResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.retry.RetryException;
import org.springframework.retry.annotation.Retryable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * User: liangZongXi
 * Create time: 15:34 2019/6/4
 * Description:
 */
@Debug
@Service
@Transactional
@Retryable(value = {RetryException.class})
public class LoanLargeOuterTemplateServiceImpl extends BaseAuditServiceImpl<LoanLargeOuterTemplate, Long> implements LoanLargeOuterTemplateService {

    @Autowired
    private LoanLargeOuterTemplateRepository loanLargeOuterTemplateRepository;

    @Override
    public Page<LoanLargeOuterTempLateListResponse> list(PageSearcher<LoanLargeOuterTempLateListRequest> pageSearcher) {
        return loanLargeOuterTemplateRepository.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
    }

    @Override
    public LoanLargeOuterTemplate findLoanLargeOuterTemplateByTemplateId(Integer templateId) {
        return loanLargeOuterTemplateRepository.findLoanLargeOuterTemplateByTemplateId(templateId);
    }

    @Override
    protected JPAAuditRepository<LoanLargeOuterTemplate, Long> getRepository() {
        return loanLargeOuterTemplateRepository;
    }
}
